/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/views/layout/Layout'

const nestedRouter = {
  path: "/content",
  component: Layout,
  redirect: "/content/content",
  name: "content",
  alwaysShow: true,
  meta: {
    title: "内容管理",
    icon: "neirong",
    roles: 'cms'
  },
  children: [
    {
      path: "/content/carousel",
      component: () => import("@/views/content/carousel/carousel"),
      name: "carousel",
      meta: {
        title: "轮播图",
        roles: 'cms_lbt',
        noCache: true,
      }
    },
    {
      path: "/content/AppStart",
      component: () => import("@/views/content/AppStart/AppStart"),
      name: "AppStart",
      meta: {
        title: "App启动页",
        roles: 'cms_app_start_page',
        noCache: true,
      }
    },
    {
      path: "docs",
      component: () => import("@/views/content/docs/docs"),
      name: "docs",
      alwaysShow: true,
      meta: {
        title: "文档配置",
        roles: 'cms_docs',
      },
      children : [
        {
          path: 'newDocs',
          component: () => import('@/views/content/docs/newDocs/newDocs'),
          name: 'newDocs',
          meta: {
            title: '新增文章',
            roles : 'add_docs'
          }
        },
        {
          path: 'docsList',
          component: () => import('@/views/content/docs/docsList/docsList'),
          name: 'docsList',
          meta: {
            title: '文章列表',
            roles :'list_docs'
          }
        },
      ]
    },
    {
      path: 'hepl',
      component: () => import('@/views/content/help/help'),
      name: 'hepl',
      alwaysShow: true,
      meta: {
        title: '帮助中心',
        roles : 'cms_helper'
      },
      children: [
        {
          path: 'issue',
          component: () => import('@/views/content/help/issue/issue'),
          name: 'issue',
          meta: {
            title: '问题',
            roles : 'cms_helper_qa'
          }
        },
        {
          path: 'issueClass',
          component: () => import('@/views/content/help/issueClass/issueClass'),
          name: 'issueClass',
          meta: {
            title: '问题类目',
            roles : 'cms_helper_qa_type'
          }
        },
      ]
    },
    {
      path: "/advertising/advertising",
      component: () => import("@/views/content/advertising/advertising"),
      name: "advertising",
      meta: {
        title: "广告配置",
        roles: 'advertising',
        noCache: true,
      }
    },
    // {
    //     path: "/content/floatingWindow",
    //     component: () => import("@/views/content/floatingWindow/floatingWindow"),
    //     name: "floatingWindow",
    //     meta: {
    //       title: "浮窗配置",
    //       roles: 'floatingWindow',
    //     }
    // },
  ]
}

export default nestedRouter
